cmake_minimum_required(VERSION 3.15)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
project(CoordTrans LANGUAGES CXX DESCRIPTION "坐标转换接口库")
#windows平台设置编码字符集和执行字符集都是utf-8,linux平台设置RPATH为当前文件夹以及下属的lib文件夹，以便于能找到依赖的动态库
if (WIN32)
    if(MSVC)
        add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/source-charset:utf-8>")
        add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/execution-charset:gbk>")
    else()
    endif()
elseif(UNIX)
    set(CMAKE_INSTALL_RPATH "$ORIGIN:$ORIGIN/lib:$ORIGIN/../lib")
else()

endif()

# 是否编译 Applications
option(BUILD_APPLICATIONS "Enable to build OSG Applications (e.g. osgviewer)" ON)

add_subdirectory(src)

if(BUILD_APPLICATIONS AND NOT ANDROID)
    add_subdirectory(application)
endif()